package com.int_tech.user.dao;

import com.int_tech.user.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Administrator on 2017/9/21.
 */
public interface UserDao extends JpaRepository<User,Integer> {
    User findUserByNameAndPasswordAndIsDel(String name,String password,int isDle);
    User findUserByNameAndTypeAndIsDel(String name,int type,int isDle);
    List<User> findByIdInAndIsDel(List<Integer>Ids,int isDle);
    List<User> findUserByIsDel(Pageable pageable,int isDle);
    List<User> findUserByIsDel(int isDle);

    List<User> findByClientId(String id);

    User findByNameAndLegalPerson(String name, String legalPerson);

    User findById(int userId);

    List<User> findByType(int i);

    List<User> findByClientIdAndType(String clientId, int i);

    Page<User> findByClientIdAndIsDel(Pageable pageable,String clientId,int isDel);

    Page<User> findByIsDel(Pageable pageable,int isDel);

    User findUserByNameAndPassword(String name,String password);

    List<User> findByClientIdAndIsDel(String clientId,int isDel);

    User findByName(String userName);

    User findByClientName(String clientName);
}
